<?php
/***
 * 描述：订单统计[管理员权限]
 * @category		Admin		
 * @package			Action			
 * @subpackage			
 * @author			wanght <whtaok@gmail.com>
 * @since			2013-4-6
 * @version			$Id: OrderManageAction.class.php 3 2013-10-14 02:49:41Z whtaok@gmail.com $
 */
class OrderStatAction extends AdminAction {
	
	/**
	 *
	 * @access		protected
	 * @author		wanght<whtaok@gmail.com>
	 * @since		2013-3-3
	 */
	protected  function _initialize() {
		parent::_initialize();
		$this->usingModel="OrderLib";
	}
	
	/**
	 * 描述：查询订单金额信息：默认查询当日
	 * @access		public
	 * @author		wanght<whtaok@gmail.com>
	 * @since		2013-3-3
	 */
	public function indexAct() {
		$search = array(
				'order_type'=> I('order_type'),
				'order_status'=> I('order_status'),
				'cust_order_status'=> I('cust_order_status'),
				'cust_order_time_start'=> I('cust_order_time_start',date('Y-m-d')),
				'cust_order_time_end'=> I('cust_order_time_end',date('Y-m-d')),
		);
		//1.查询指定日期的订单数量
		$orderStat = OrderStatModel::statOrder($this->curr_shop_id,$search);
		$this->assign('orderStat',$orderStat);
		$this->assign('search',$search);
		$this->display('index');
	}
	/**
	 * 描述：统计商品销售情况
	 * @access		public
	 * @author		wanght<whtaok@gmail.com>
	 * @since		2013-3-3
	 */
	public function statProductAct(){
		$search = array(
				'order_type'=> I('order_type'),
				'order_status'=> I('order_status'),
				'cust_order_status'=> I('cust_order_status'),
				'cust_order_time_start'=> I('cust_order_time_start',date('Y-m-d')),
				'cust_order_time_end'=> I('cust_order_time_end',date('Y-m-d')),
				'order_by' => I('order_by',1)
		);
		//1.查询指定日期的订单数量
		$prodStat = OrderStatModel::statProduct($this->curr_shop_id,$search);
		$this->assign('prodStat',$prodStat);
		$this->assign('search',$search);
		$this->display('statProd');
	}

}

?>